#include  <func.h>
//客户端-->服务端
int transfile(int netfd,char*path){
    train_t train;
    train.lenth=strlen(path);
    strcpy(train.data,path);
    send(netfd,&train,sizeof(int)+train.length,MSG_NOSIGNAL);//文件名
    int fd = open("file1",O_RDWR);
    while(1){
        bzero(&train,sizeof(train));
        ssize_t ret = read(fd,train.data,sizeof(train.data));
        train.length = ret;
        send(netfd,&train,sizeof(int)+train.length,MSG_NOSIGNAL);//文件内容
        if(ret == 0){
            break;
        }
    }
    close(fd);
    return 0;
    }

